package com.midea.oms.Dto;

import com.alibaba.excel.EasyExcel;
import com.midea.oms.utils.ExcelListener;
import lombok.val;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.boot.autoconfigure.mail.MailProperties;
import org.springframework.util.ObjectUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @projectName: 接口梳理
 * @package: com.midea.oms.Dto
 * @className: Test2
 * @author: zhangcan30
 * @description: TODO
 * @date: 2024/1/2 15:16
 * @version: 1.0
 */
public class Test2 {
    public static void main(String[] args) throws FileNotFoundException {


        String url = "C:/Users/zhangcan30/Desktop/aaa/aaa.xlsx";

        File file = new File(url);

        InputStream inputStream = new FileInputStream(file);


        // 监听器
        ExcelListener<AccountabilityTemplateDtoImport> listener = new ExcelListener<>();

        // 读取文件,自动关闭文件流
        EasyExcel.read(inputStream, AccountabilityTemplateDtoImport.class, listener).sheet(0).headRowNumber(2).doRead();

        // 获取内容列表
        List<AccountabilityTemplateDtoImport> dataList = listener.getDataList();
        System.out.println(dataList);

    }

}
